var picList = [
	{"smallImg":"Content/Images/GNE/26585_25262_GNEV122E_medium.jpg",
		"mediumImg":"Content/Images/GNE/26585_25262_GNEV122E_medium.jpg",
		"largeImg":null,"link":null},
	{"smallImg":"Content/Images/GNE/26585_25411_GNE-V-122-E-LOW.jpg",
		"mediumImg":"26585_25411_GNE-V-122-E-LOW_medium.jpg",
		"largeImg":null,"link":null}
];

$(function(){
	ap_init();
	$("#proImagesWrapper ul.smallList li").click(function(){
		var mediumImg = $(this).attr("data-mediumImg");
		alert(mediumImg);
		var target = $("#proImagesWrapper .picBox a");
		target.html("");
		target.append('<img src="'+mediumImg+'" />');
		target.attr("href",mediumImg);
	});
});

function ap_init()
{
	var smallList = $("#proImagesWrapper").find("ul.smallList");
	//生成脚本
	smallList.html("");
	for (i=0;i<picList.length;i++) {
		var smallImg = picList[i].smallImg;
		if (CheckIsEmpty(smallImg)) { continue;}
			var mediumImg = picList[i].mediumImg;
			if (CheckIsEmpty(mediumImg)) {mediumImg=smallImg};
			var largeImg = picList[i].largeImg;
			if (CheckIsEmpty(largeImg)) {largeImg=mediumImg};
			var link = picList[i].link;
			if (CheckIsEmpty(link)) {link=""};
			smallList.append('<li data-mediumImg="' + mediumImg + '" data-largeImg="'+largeImg+'" data-link="'+link+
				'"><img src="'+smallImg+'" /></li>');
		
	}
}

function CheckIsEmpty(obj){
	return obj=="" || obj==null || typeof(obj)=="undifined";
}

function ChangeAlbumPic(){

}